#include "Source.h"
#include "SourceSketcher.h"

Source::Source(void)
{
	this->setType("Source");
}
Source::Source(Position *position) {
	this->setPosition(position);
}

Source::Source(Position *position,float radius) {
	this->setRadius(radius);
	Source::Source(position);
}

Source::Source(Position *position,float radius,Color * color) {
	this->setElementColor(color);
	Source::Source(position,radius);
}

Source::Source(Position *position,float radius,Texture *texture) {
	this->setTexture(texture);
	Source::Source(position,radius);
}
float Source::getMinXPos(){
	return this->getPosition()->getAxisX()-this->radius;
}
	
float Source::getMinYPos(){	
	return this->getPosition()->getAxisY()-this->radius;
}
	
float Source::getMaxXPos(){	
	return this->getPosition()->getAxisX()+this->radius;
}
	
float Source::getMaxYPos(){
	return this->getPosition()->getAxisY()+this->radius;
}


/*-------------Getters & Setters--------------------*/
void Source::setPosition(Position *position){
	this->position = position;
}
Position *Source::getPosition(){
	return this->position;
}
Color * Source::getElementColor(){
	return this->elementColor;
}
void Source::setElementColor(Color * color){
	this->elementColor = color;
}
float Source::getRadius(){
	return this->radius;
}
void Source::setRadius(float radius){
	this->radius = radius;
}
Texture *Source::getTexture(){
	return this->texture;
}

void Source::setTexture(Texture *texture){
	this->texture = texture;
}
/*---------------Destructor----------------------------*/

Source::~Source() {
	delete(this->texture);
	delete(this->position);
}

Color * Source::getLineColor()
{
	return this->lineColor;
}

void Source::setLineColor( Color * color )
{
	this->lineColor = color;
}

void Source::draw()
{
	Sketcher* sketcher = new SourceSketcher(this);
	sketcher->draw();
	delete(sketcher);
}
